package cn.yj.common.interfaces;

import cn.yj.common.entity.PayOrder;
import cn.yj.common.entity.PayRefundOrder;
import cn.yj.common.entity.RefundQueryParams;
import cn.yj.common.exception.PayException;
import com.alipay.api.AlipayApiException;

/**
 * 统一下单支付接口
 *
 * @author 永健
 * @since 2022-02-17 19:48
 */
public interface IPay<T, R> {
    /**
     * 支付下单接口
     *
     * @param payRequest 请求参数
     */
    R underOrder(T payRequest) throws PayException;

    /**
     * 订单状态查询接口
     *
     * @param outTradeNo
     *
     * @throws AlipayApiException
     */
    PayOrder queryOrder(String outTradeNo) throws PayException;

    /**
     * 退款订单查询借口
     * @param params
     * @return
     * @throws PayException
     */
    PayRefundOrder queryRefundOrder(RefundQueryParams params) throws PayException;


}
